#/bin/bash

sum=0
count=1
while [ $count -le 100 ]
do
    sum=$[$sum+$count]
    count=$[$count+1]
done

echo "sum=$sum"

echo "Please enter your password!"
read try
errCount=1
while [ "$try" != "secret" ]
do
    errCount=$[$errCount+1]
    echo "Sorry, try again!"
    read try
    #错误5次，则退出while循环
    if [ "$errCount" -ge 5 ]
    then 
        echo "Error 5 times, exit!"
        break
    fi
done

if [ "$errCount" -lt 5 ]
then
    echo "Download success!"
fi
